(function($){
	
	$.app = $.app || {version: '1.0.0'};
	$.app.realmwar = {
		
		addEffect: function(name, loadFn, hideFn) {
			effects[name] = [loadFn, hideFn];
		},
		
		conf: {
			close:null,
			effect: 'default',
			position:['top', 'right'],
			offset: [0, 0],
			relative: false,
			predelay: 0,
			delay: 30,
			load:false,
			fixed: !$.browser.msie || $.browser.version > 6,
			oneInstance:true,
			
			isShowing: true
			
			}
	};
	
	var instances = [], effects = {};
	
	$.app.realmwar.addEffect('default', function() {}, function() {});
	
	function getWinSize(trigger, conf) {
		
	}
	
	function RealmWar(trigger, conf) {
		var self = this,
			fire = trigger.add(self),
			w = $(window),
			closers,
			floatObj,
			opened,
			userAgent;
			
		floatObj = trigger;
		if (!floatObj.length) {}
		
		$.extend(self, {
			load:function(e) {
				
			}
		});
	}
	
    $.fn.realmwar = function(conf) {
        var api = this.data("realmwar");
        if (api) {return api;}
        
        if ($.isFunction(conf)) {
        	conf = {onBeforeLoad:conf};
        }
        conf = $.extend(true, {}, $.app.realmwar.conf, conf);
		this.each(function() {
			api = new RealmWar($(this), conf);
			instances.push(app);
			$(this).data("realmwar", api);
		});
		
		return conf.api ? api: this;
    }    
})(jQuery);
